# Standardization Cell MATLAB Toolkit (QCA + Sentaurus Export)

This repository contains a set of MATLAB GUIs for designing and exporting
parametric **quantum-dot cellular automata (QCA)** standard cells and logic
structures.  

The tools generate both **3D visualizations** and **Synopsys Sentaurus SDE / SDevice**
decks for TCAD simulation.

---

## 1. Main Features

- Parametric **standard cell** definition (SiO₂, Ti, Au, HfO₂, vacuum).
- Built-in GUIs for:
  - Single standard cell (and variants).
  - N-phase cell arrays.
  - Majority Voter (MV) structures (standard and cross-vacuum).
  - L-wire and T-wire interconnects (standard and cross-vacuum).
- **Custom Layout GUI**:
  - 2D canvas (10×10) where MV / L-wire / T-wire / Bus blocks can be placed.
  - Automatic neighbor-based packing and 3D preview.
  - Consistent left-to-right signal flow convention.
- **Export to Sentaurus**:
  - SDE geometry as explicit cuboids (SiO₂, Titanium, Gold, HfO₂, Vacuum).
  - SDevice decks with electrodes and thermodes only for existing contacts.
  - Structured and consistent **TopContact_*** naming for all layouts.

Tested on **MATLAB R2023b**.

---

## 2. Folder Contents (Core Files)

The key MATLAB entry points are:

- `stdcell_launcher.m`  
  Main launcher GUI. Lets you pick which structure editor to open.

- `stdcell_gui.m`  
  Standard single cell editor.

- `stdcell_gui_cutY_far_flush_with_Ti.m`  
  Standard cell variant with Y-cut aligned to the Ti film.

- `stdcell_array_gui.m`  
  N-phase array builder. Duplicates the cell along Y (last cells standard, previous CUTs).

- `stdcell_mv_gui.m`  
  Majority Voter (MV) cross structure with symmetric arms and layered corner fillers.

- `stdcell_mv_crossvac_gui.m`  
  MV with **HfO₂ center block + cross-vacuum** and square Au cap.

- `stdcell_lwire_gui.m`  
  L-wire structure (2 perpendicular arms) for routing.

- `stdcell_lwire_crossvac_gui.m`  
  L-wire with HfO₂ center block + cross vacuum.

- `stdcell_twire_gui.m`  
  T-wire structure with 3 arms for routing.

- `stdcell_twire_crossvac_gui.m`  
  T-wire with HfO₂ center block + cross vacuum.

- `custom_layout_gui.m`  
  2D canvas + 3D editor for composing **MV / L-wire / T-wire / Bus** blocks into
  complex layouts and exporting SDE/SDevice decks.

---

## 3. Requirements

- **MATLAB** R2023b or later (earlier versions may work but are not tested).
- Standard MATLAB GUI components (`uifigure`, `uigridlayout`, `uiaxes`, etc.).
- Image files for canvas icons (if used):
  - `mv.png`, `lwire.png`, `twire.png`, `bus.png` in the same folder as
    `custom_layout_gui.m`.

No additional toolboxes should be strictly required beyond base MATLAB and
image I/O.

---

## 4. Getting Started

1. **Unzip** the project into a folder of your choice.
2. Start MATLAB and set the project folder as the **Current Folder** or add it
   to the path:
   ```matlab
   addpath(genpath('path/to/your/project'));
